<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md15">
                    <div class="layui-row layui-col-space15">
                        <div class="layui-col-md12">
                            <div class="layui-card">
                                <div class="layui-card-header">激活码管理</div>
                                <br>
                                <form class="layui-row layui-form " style="display: flex;flex-direction: row" action="">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">筛选</label>
                                        <div class="layui-input-inline">
                                            <select name="cs" id="cs" lay-filter="cs">
                                                <option value="">全部</option>
                                                <option value="0" selected="">第一册</option>
                                                <option value="1">第二册</option>
                                                <option value="2">第三册</option>
                                                <option value="3">第四册</option>
                                                <option value="4">第五册</option>
                                                <option value="5">第六册</option>
                                            </select>
                                        </div>
                                        <div class="layui-input-inline">
                                            <select name="active" id="active" lay-filter="active">
                                                <option value="">请选择激活状态</option>
                                                <option value="10" selected="">全部</option>
                                                <option value="1">已激活</option>
                                                >
                                                <option value="0">未激活</option>

                                            </select>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">查询类型</label>
                                        <div class="layui-input-block " id="audio">
                                            <input name="code" title="激活码" type="radio" lay-filter="code" checked=""
                                                   value="key">
                                            <input name="code" title="设备ID" type="radio" lay-filter="code" value="mac">
                                            <input name="code" title="备注" type="radio" lay-filter="code" value="info">
                                        </div>
                                    </div>

                                    <div class="layui-form-item layui-col-md2">
                                        <label class="layui-form-label">关键字</label>
                                        <div class="layui-input-block">
                                            <input name="keyword" id="keyword" class="layui-input" type="text"
                                                   placeholder="请输入关键字" autocomplete="off" lay-verify="keyword">
                                        </div>
                                    </div>
                                    &nbsp;&nbsp;<a class="layui-btn" id="search"><i
                                                class="layui-icon layui-icon-search">&#xe615;</i></a>
                                </form>
                                <div class="layui-card-body">
                                    <table id="codeTable" lay-filter="codeTable"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<div class="layui-content" id="create-active-box" style="display: none">
    <div class="layui-card" style="height:100%">
        <div class="layui-card-header">一键创建并激活</div>
        <form class="layui-form layui-card-body" action="">
            <div class="layui-form-item">
                <label class="layui-form-label" id="Active_unit">*单元：</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="Active_unit" value="0" title="第一册">
                    <input type="checkbox" name="Active_unit" value="1" title="第二册">
                    <input type="checkbox" name="Active_unit" value="2" title="第三册">
                    <input type="checkbox" name="Active_unit" value="3" title="第四册">
                    <input type="checkbox" name="Active_unit" value="4" title="第五册">
                    <input type="checkbox" name="Active_unit" value="5" title="第六册">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">*mac：</label>
                <div class="layui-input-block">
                    <input name="MAC" class="layui-input" type="text" id="macInput" placeholder="mac"
                           autocomplete="off"
                           lay-verify="MAC">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注：</label>
                <div class="layui-input-block">
                    <input name="Active_desc" class="layui-input" type="text" id="Active_desc" placeholder="请输入备注"
                           autocomplete="off"
                           lay-verify="desc">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">*有效期：</label>
                    <div class="layui-input-inline">
                        <input name="Active_num" class="layui-input" placeholder="/天" id="Active_num" type="number"
                               autocomplete="off" lay-verify="Active_num">
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <select id="Active_time"
                                style="font-size: 28px; text-align: right; font-weight: bold; width: 10%;">
                            <option value="day">天</option>
                            <option value="month">月</option>
                            <option selected="selected" value="year">年</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="float: right;right: 50px">
                    <a class="layui-btn layui-btn-blue" id="Active_sumbit" onclick="Active_sumbit()" lay-submit
                       lay-filter="Active_sumbit">一键创建并激活</a>
                </div>
            </div>
        </form>
    </div>
    <div class="layui-card-body">
        <table id="Active_table" lay-filter="Active_table"></table>
    </div>
</div>
<div class="layui-content" id="activeBox" style="display: none">
    <div class="layui-card" style="height:100%">
        <div class="layui-card-header">生成教师激活码</div>
        <form class="layui-form layui-card-body" action="">
            <div class="layui-form-item">
                <label class="layui-form-label" id="unitOne">单元：</label>
                <div class="layui-input-block">
                    <input type="checkbox" name="unit" value="0" title="第一册">
                    <input type="checkbox" name="unit" value="1" title="第二册">
                    <input type="checkbox" name="unit" value="2" title="第三册">
                    <input type="checkbox" name="unit" value="3" title="第四册">
                    <input type="checkbox" name="unit" value="4" title="第五册">
                    <input type="checkbox" name="unit" value="5" title="第六册">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注：</label>
                <div class="layui-input-block">
                    <input name="desc" class="layui-input" type="text" id="desc" placeholder="请输入备注"
                           autocomplete="off"
                           lay-verify="desc">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">有效期：</label>
                    <div class="layui-input-inline">
                        <input name="range_num" class="layui-input" placeholder="/天" id="range_num" type="number"
                               autocomplete="off" lay-verify="time">
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <select id="range_time"
                                style="font-size: 28px; text-align: right; font-weight: bold; width: 10%;">
                            <option value="day">天</option>
                            <option value="month">月</option>
                            <option selected="selected" value="year">年</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block" style="float: right;right: 50px">
                    <a class="layui-btn layui-btn-blue" id="addActive" onclick="createCode()" lay-submit
                       lay-filter="createCode">生成教师激活码</a>
                </div>
            </div>
        </form>
    </div>
    <div class="layui-card-body">
        <table id="createCode" lay-filter="createCode"></table>
    </div>
</div>
<div class="layui-content" id="addCodeBox" style="display: none">
    <div class="layui-card" style="height:100%">
        <div class="layui-card-header">新增激活码</div>
        <form class="layui-form layui-card-body" action="">
            <div class="layui-inline">
                <label class="layui-form-label">单元</label>
                <div class="layui-input-inline">
                    <select name="unit" id="newUnit" lay-filter="unit">
                        <option value="">请选择第几册</option>
                        <option value="0" selected="">第一册</option>
                        <option value="1">第二册</option>
                        <option value="2">第三册</option>
                        <option value="3">第四册</option>
                        <option value="4">第五册</option>
                        <option value="5">第六册</option>
                    </select>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">有效期</label>
                <div class="layui-input-inline">
                    <input name="term" class="layui-input" placeholder="/天" id="term" type="number" autocomplete="off"
                           lay-verify="term">
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">数量</label>
                <div class="layui-input-inline">
                    <input name="count" id="count" placeholder="/个" class="layui-input" type="number" autocomplete="off"
                           lay-verify="count">
                </div>
            </div>
        </form>

        <div class="layui-row layui-col-space12">
            <div class="layui-col-md12" style="text-align: center">
                <div class="layui-card-body" id="message">

                </div>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block" style="float: right;right: 50px">
            <a class="layui-btn layui-btn-blue" id="addActive" onclick="addActiveCode()" lay-submit
               lay-filter="updatePerson">立即添加</a>
        </div>
    </div>
    <div class="layui-card-body">
        <table id="newCodeTable" lay-filter="newCodeTable"></table>
    </div>
</div>
<div class="layui-content" id="delayBox" style="display: none">

    <div class="layui-card-header">延期</div>
    <form class="layui-form layui-card-body" action="" lay-filter="updateBox">
        <div class="layui-form-item">
            <label class="layui-form-label">延长日期</label>
            <div class="layui-input-inline">
                <input name="delay" class="layui-input" id="delay" type="text" placeholder="yyyy-MM-dd"
                       autocomplete="off" lay-verify="delay">
            </div>
            <div class="layui-form-mid layui-word-aux" id="delayTime"></div>
        </div>
    </form>

    <div class="layui-row layui-col-space12">
        <div class="layui-col-md12" style="text-align: center">
            <div class="layui-card-body" id="message">

            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block" style="float: right;right: 50px">
            <a class="layui-btn layui-btn-blue" id="updateDelay" onclick="updateDelay()" lay-submit
               lay-filter="saveNotice">保存</a>
        </div>
    </div>
</div>
<script id="toolbarDemo" type="text/html">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" onclick="addActive()"><i class="layui-icon">&#xe608;</i>
            创建激活码
        </button>
        <button class="layui-btn layui-btn-sm  layui-btn-normal" onclick="crateActive()"><i
                    class="layui-icon">&#xe609;</i>
            创建并激活
        </button>
        <button class="layui-btn layui-btn-sm layui-btn-normal" onclick="refresh()"><i class="layui-icon">&#xe9aa;</i>
            刷新
        </button>
    </div>
</script>
<script>
    var startInter = api.codeApi;
    var audio = "", cs = "", active = "", keyword = "", preDelay, delayId;//初始化查询身份为教师,与当前的时间
    var type = /^[1-9]\d*$/;
    $(document).ready(function () {
        $("#search").click(function () {
            getStartUp();
        });
        cs = $("#cs").val();
        active = "";
        keyword = $("#keyword").val();
        audio = $("input[name='code']:checked").val();
        
        $("#term").bind('input propertychange', function () {
            var term = $("#term").val();

            if (!type.test(term)) {
                $("#term").val("");
                $("#message").html("  <a style='color:red'>  <i class=\"layui-icon\" style=\"color: red\">&#x1006;</i> 输入有误，请输入正整数</a>");
                $("#addActive").addClass("layui-btn-disabled");

                return false;
            }
            else {
                $("#addActive").removeClass("layui-btn-disabled");
                $("#message").html("  <a style='color:green'>  <i class=\"layui-icon\" style=\"color: green\">&#xe605;</i> 输入正确</a>");
            }
        });

        $("#count").bind('input propertychange', function () {
            var count = $("#count").val();

            if (!type.test(count)) {
                $("#count").val("");
                $("#addActive").addClass("layui-btn-disabled");
                $("#message").html("  <a style='color:red'>  <i class=\"layui-icon\" style=\"color: red\">&#x1006;</i> 输入有误，请输入正整数</a>");
                return false;
            }
            else {
                $("#addActive").removeClass("layui-btn-disabled");
                $("#message").html("  <a style='color:green'>  <i class=\"layui-icon\" style=\"color: green\">&#xe605;</i> 输入正确</a>");
            }

        });

        $("#range_num").bind('input propertychange', function () {
            var range_num = $("#range_num").val();
            if (!type.test(range_num)) {
                $("#range_num").val("");
                layer.tips('有效期必须为正整数哦', '#range_num');
            }
        });
        $("#Active_num").bind('input propertychange', function () {
            var Active_num = $("#Active_num").val();
            if (!type.test(Active_num)) {
                $("#Active_num").val("");
                layer.tips('有效期必须为正整数哦', '#Active_num');
            }

        });
        $("#macInput").bind('input propertychange', function () {
            var mac = $("#macInput").val();
            if (mac.length<9) {
                layer.tips('mac长度必须大于10哦！', '#macInput');
            }
            else {
                layer.tips('输入正确！', '#macInput');
            }

        });

        layui.use(['form', 'table', 'laydate'], function () {
            var form = layui.form
                , layer = layui.layer
                , laydate = layui.laydate;
            laydate.render({
                elem: '#delay',
                type: 'datetime'
            });

            //监听单选框的值
            form.on("radio(code)", function (data) {
                audio = data.value;
                getStartUp();

            });
            //监听筛选的选择框
            form.on("select(cs)", function (data) {
                cs = data.value;
                getStartUp();
            });
            //监听active的值
            form.on('select(active)', function (data) {
                if (data.value == "10") {
                    active = "";
                }
                else {
                    active = data.value;
                }

                getStartUp();
            });

            $("#keyword").bind('input propertychange', function () {
                keyword = $("#keyword").val();
                getStartUp();
            });
            form.render();
        });
        getStartUp();
    });

    function addCode() {

        personWin = layer.open({
            type: 1,
            shade: false,
            area: ['60%', '75%'], //宽高
            title: false, //不显示标题
            content: $('#addCodeBox'),
            cancel: function () {
                document.getElementById("addCodeBox").style.display = "none";
            }
        });
    }

    function addActive() {
        personWin = layer.open({
            type: 1,
            shade: false,
            area: ['60%', '75%'], //宽高
            title: false, //不显示标题
            content: $('#activeBox'),
            cancel: function () {
                document.getElementById("activeBox").style.display = "none";
            }
        });
    }

    function crateActive() {
        personWin = layer.open({
            type: 1,
            shade: false,
            area: ['60%', '75%'], //宽高
            title: false, //不显示标题
            content: $('#create-active-box'),
            cancel: function () {
                document.getElementById("create-active-box").style.display = "none";
            }
        });
    }

    function refresh() {
        getStartUp();
    }

    //获取启动次数的数据
    function getStartUp() {
        layui.use('table', function () {
            var table = layui.table;
            //第一个实例
            table.render({
                elem: '#codeTable'
                , url: "api/coList.php" //数据接口
                , title: '激活码列表数据'
                , page: true //开启分页
                , toolbar: "#toolbarDemo"
                , method: 'POST'
                , limit: 100
                , limits: [20, 40, 60, 100, 200]

                , where: {
                    Cs: cs,
                    Active: active,
                    type: audio,
                    action: "listCode",
                    word: keyword
                }
                , cols: [[ //表头
                    {field: 'index', title: '序号', fixed: 'left', type: 'numbers', toolbar: "#tableId"}
                    , {field: 'keyvalue', title: '激活码', width: 180}
                    , {field: 'vol', title: '第几册', width: 100, toolbar: "#uNit"}
                    , {field: 'exptime', title: '有效时间', width: 100, toolbar: "#expTime"}
                    , {field: 'acttime', title: '激活时间', width: 170, toolbar: "#actTime"}
                    , {field: 'endtime', title: '到期时间', width: 170, toolbar: "#endTime"}
                    , {field: 'Mac', title: '设备ID', width: 350}
                    , {field: 'isexp', title: '是否过期', width: 100, toolbar: "#isExp"}
                    , {field: 'isact', title: '是否激活', width: 100, toolbar: "#isAct"}
                    , {field: 'isout', title: '是否印卡', width: 100, toolbar: "#isOut"}
                    , {field: 'info', title: '备注', width: 200}
                    , {field: '', toolbar: '#barDemo', title: '操作'}
                ]]
                , done: function (res, curr, count) {
                    if (res.count == 0) {
                        layer.msg("没有符合条件的数据哦");
                    }
                }

            });

            table.on('tool(codeTable)', function (obj) {
                var data = obj.data, layEvent = obj.event;
                if (layEvent == 'delay') {

                    delay(data);

                }


            })


        });

    }

    //延期
    function delay(val) {
        $entTime = to_date(val.endtime);
        delayId = val.yid;
        $("#delayTime").html("到期时间：" + $entTime);
        $("#delay").val($entTime);
        preDelay = $entTime;
        personWin = layer.open({
            type: 1,
            shade: false,
            area: ['50%', '30%'], //宽高
            title: false, //不显示标题
            content: $('#delayBox'),
            cancel: function () {
                document.getElementById("delayBox").style.display = "none";
            }
        });

    }

    //修改到期时间
    function updateDelay() {
        $delay_time = $("#delay").val();
        $delay_time = new Date($delay_time);
        $delay_time = $delay_time.getTime();
        $preTime = new Date(preDelay);
        $preTime = $preTime.getTime();
        if ($delay_time > $preTime) {
            $delay_time = $delay_time / 1000;
            $.ajax({
                type: "post",
                cache: "false",
                url: "api/coList.php",
                data: {
                    "action": "updateDela",
                    "cId": delayId,
                    "eTime": $delay_time,
                },
                dataType: 'json',
                success: function (res) {
                    layer.msg(res.msg);
                    document.getElementById("addCodeBox").style.display = "none";
                    parent.layer.close(personWin);
                    getStartUp();

                },
                error: function (res) {
                    console.log(res);
                    layer.msg("添加失败");
                }


            });


        }
        else {
            layer.alert('延长的时间不能比原有到期时间短或为原有的时间', {
                title: '延长时间提醒',
                icon: 5,
            })
        }

    }

    //添加激活码
    function addActiveCode() {
        $unit = $('#newUnit').val();
        $count = $("#count").val();
        $term = $("#term").val();
        console.log($unit);
        if ($unit == "" || $count == "" || $term == "") {
            $("#message").html("  <a style='color:red'>  <i class=\"layui-icon\" style=\"color: red\">&#x1006;</i>未正确输入</a>");
        }
        else {
            layui.use('table', function () {
                var table = layui.table;
                //第一个实例
                table.render({
                    elem: '#newCodeTable'
                    , url: "api/coList.php" //数据接口
                    , title: '新激活码列表数据'
                    , method: 'POST'
                    , where: {
                        "action": "CreateCode",
                        "vol": $unit,
                        "day": $term,
                        "num": $count
                    }
                    , cols: [[ //表头
                        {field: 'index', title: '序号', fixed: 'left', type: 'numbers', toolbar: "#tableId"}
                        , {field: 'keyvalue', title: '激活码'}
                        , {field: 'vol', title: '第几册', width: 150, toolbar: "#uNit"}
                        , {field: 'exptime', title: '有效时间', toolbar: "#expTime"}
                    ]]
                    , done: function (res, curr, count) {
                        if (res.count == 0) {
                            layer.msg("没有符合条件的数据哦");
                        }
                    }

                });

            });
        }


    }

    //、生成教师激活码
    function createCode() {
        var unitSelect = $("input:checkbox[name='unit']:checked").map(function (index, elem) {
            return $(elem).val();
        }).get().join(',');

        $desc = $("#desc").val();
        var range_num = $("#range_num").val();
        var range_time = $("#range_time").val();
        var num = 1;//生成数量
        if (unitSelect == "") {
            layer.tips('单元还未选择', '#unitOne');
        }

        else if (!type.test(range_num)) {
            layer.tips('有效期必须为正整数哦', '#range_num');
        }

        else {
            unitSelect = unitSelect.split(",");
            var unit = [0, 0, 0, 0, 0, 0];
            for ($i = 0; $i < unitSelect.length; $i++) {
                unit[unitSelect[$i]] = 1;
            }

            layui.use('table', function () {
                var table = layui.table;
                //第一个实例
                table.render({
                    elem: '#createCode'
                    , url: "api/coList.php" //数据接口
                    , title: '新激活码列表数据'
                    , method: 'POST'
                    , where: {
                        "action": "createGroupKey",
                        "Cs": unit,
                        "info_comments": $desc,
                        "Much": range_num,
                        "shiJian": range_time,
                        "shuLiang": num
                    }
                    , cols: [[ //表头
                        {field: 'index', title: '序号', fixed: 'left', type: 'numbers', toolbar: "#tableId"}
                        , {field: 'keyValue', title: '激活码'}
                        , {field: 'vol', title: '第几册', toolbar: "#uNit"}
                    ]]
                    , done: function (res, curr, count) {
                        if (res.count == 0) {
                            layer.msg("没有符合条件的数据哦");
                        }
                    }

                });

            });
        }

    }

    //创建并激活
    function Active_sumbit() {
        var unitSelect = $("input:checkbox[name='Active_unit']:checked").map(function (index, elem) {
            return $(elem).val();
        }).get().join(',');
        $desc = $("#Active_desc").val();
        var range_num = $("#Active_num").val();
        var range_time = $("#range_time").val();
        var mac = $("#macInput").val();
        var num = 1;//生成数量
        if (unitSelect == "") {
            layer.tips('单元还未选择', '#Active_unit');
            return false;
        }
        if (mac.length<9) {
            layer.tips('mac长度必须大于10位哦！', '#macInput');
            return false;

        }
        else if (!type.test(range_num)) {
            layer.tips('有效期必须为正整数哦', '#Active_num');
            return false;
        }

        else {
            unitSelect = unitSelect.split(",");
            var unit = [0, 0, 0, 0, 0, 0];
            for ($i = 0; $i < unitSelect.length; $i++) {
                unit[unitSelect[$i]] = 1;
            }
            layui.use('table', function () {
                var table = layui.table;
                //第一个实例
                table.render({
                    elem: '#Active_table'
                    , url: "api/coList.php" //数据接口
                    , title: '新激活码列表数据'
                    , method: 'POST'
                    , where: {
                        "action": "createGroupKeyActive",
                        "Cs": unit,
                        "info_comments": $desc,
                        "Much": range_num,
                        "shiJian": range_time,
                        "shuLiang": num,
                        "mac":mac,
                    }
                    , cols: [[ //表头
                        {field: 'index', title: '序号', fixed: 'left', type: 'numbers', toolbar: "#tableId"}
                        , {field: 'keyValue', title: '激活码'}
                        , {field: 'vol', title: '第几册', toolbar: "#uNit"}
                    ]]
                    , done: function (res, curr, count) {
                        if (res.count == 0) {
                            layer.msg("没有符合条件的数据哦");
                        }
                    }

                });

            });
        }

    }
</script>
<!--//册-->
<script type="text/html" id="uNit">
    <a style="color: #787878" class="layui-table-link">第{{changeUnit(d.vol)}}册</a>
</script>
<!--//册-->

<!--//有效时间-->
<script type="text/html" id="expTime">
    {{#  if(d.exptime !=undefined){ }}
    <a style="color: #787878" class="layui-table-link">{{secondToDay(d.exptime)}}</a>
    {{#  } }}
</script>
<!--//有效时间-->
<script type="text/html" id="endTime">
    {{#  if(d.endtime !=undefined){ }}
    <a style="color: #787878" class="layui-table-link">{{to_date(d.endtime)}}</a>
    {{#  } }}
</script>
<!--//到期时间-->
<script type="text/html" id="actTime">
    {{#  if(d.acttime !=undefined){ }}
    <a style="color: #787878" class="layui-table-link">{{to_date(d.acttime)}}</a>
    {{#  } }}
</script>
<!--//更新时间-->
<script type="text/html" id="updateTime">
    {{#  if(d.updatetime !=undefined){ }}
    <a style="color: #787878" class="layui-table-link">{{to_date(d.updatetime)}}</a>
    {{#  } }}
</script>
<!--//是否过期-->
<script type="text/html" id="isExp">
    {{#  if(d.isexp =="1"){ }}
    <a style="color:#009688" class="layui-table-link">已过期</a>
    {{#  } }}
    {{#  if(d.isexp =="0"){ }}
    <a style="color: #787878" class="layui-table-link">未过期</a>
    {{#  } }}
</script>
<!--//是否激活-->
<script type="text/html" id="isAct">
    {{#  if(d.isact =="1"){ }}
    <a style="color:#009688" class="layui-table-link">已激活</a>
    {{#  } }}
    {{#  if(d.isact =="0"){ }}
    <a style="color: #787878" class="layui-table-link">未激活</a>
    {{#  } }}
</script>
<!--//是否印卡-->
<script type="text/html" id="isOut">
    {{#  if(d.isout =="1"){ }}
    <a style="color:#009688" class="layui-table-link">印卡</a>
    {{#  } }}
    {{#  if(d.isout =="0"){ }}
    <a style="color: #787878" class="layui-table-link">未印卡</a>
    {{#  } }}
</script>

<!--//时间延期-->
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="delay"><i class="layui-icon">&#xe642;</i>延期</a>
</script>